home *** CD-ROM | disk | FTP | other *** search
- For all who asked. Here's the 4 button code.
-
- The program is very simple and should be self explanatory.
- I added some extra comments to help with the harder points.
-
- The modification to the sega joypad are very simple, just cross
- the 5 and 7 pins. If you want to open the joypad and perform a
- solder job fine. But the best thing to do is to run down to Radio Shack
- and get the parts to build an adapter, you will need:
- 1 Male 9 Pin kit
- 1 Female 9 Pin kit
- 2 plastic shielding covers
- wire
-
- Cut the shielding covers in half and glue the two covers together
- and glue the two bottoms together. Assemble the plugs remembering
- to cross 5 on one end with 7 on the other. The pin out should look
- like this:
-
- 1---------1
- 6-------------6
- 2---------2
- 7---\ /---7
- 3--\---/--3
- 8-----\-/-----8
- 4----x----4
- 9-----/-\-----9
- 5--/ \--5
-
- Solder no two wires together. Place the shielding covers on and tape
- shut. You can glue the covers shut once your sure it works ok.
-
- The code is based on a article in Amiga Format that came out last
- summer, I don't remember the exact issue but the assembly version
- of this code was on the cover disk.
-
- The code could be shortened in many different ways, but for
- simplicity heres the long version.
-
- /------Cut and remove commments, but not the procedure header------\
-
- Do
- Proc SEGAFIRE[0]
- Print Bin$(Param,4)
- Proc SEGAFIRE[1]
- Print Bin$(Param,4)
- Loop
-
- Procedure SEGAFIRE[BUTTON]
- ' Amiga 4-button joystick code...
- '
- ' Stick discovery by Ed Bamber
- ' Code created by Anthony Ball
- ' Converted to AMOS by Brad Gust
- '
- ' (C)1992 Anthony Ball & Edmund Bamber
- ' (C)1994 Brad Gust
- '
- ' Requires a SEGA joystick with wires 5 & 7 swapped
- '
- REG=$0
- If BUTTON
- If Fire(1) Read normal button one port 1
- REG=REG+$4 Set status bit
- End If
- If Not Btst(6,$DFF016) Read normal button Two port 1
- REG=REG+$2 Set status bit
- End If
- Doke $DFF034,$E000 Force port 1 into a different mode.
- If Fire(1) Reading button 1 again gives different
- answer
- REG=REG+$8 Set status bit
- End If
- If Not Btst(6,$DFF016) Read button 2 again, different answer
- REG=REG+$1 Set status bit
- End If
- Else
- If Fire(0) Read normal button one port 0
- REG=REG+$4 Set status bit
- End If
- If Not Btst(2,$DFF016) Read normal button Two port 0
- REG=REG+$2 Set status bit
- End If
- Doke $DFF034,$E00 Force port 0 into a different mode.
- If Fire(0) ....
- REG=REG+$8 ....
- End If
- If Not Btst(2,$DFF016) ....
- REG=REG+$1 ....
- End If
- End If
- End Proc[REG]
-
-